package org.example.library;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.ptr.IntByReference;

public interface WintunLibrary extends Library {
    WintunLibrary INSTANCE = (WintunLibrary) Native.load("wintun", WintunLibrary.class);

    Pointer WintunCreateAdapter(WString name, WString tunnelType, Pointer requestedGUID);

    Pointer WintunStartSession(Pointer sessionHandle, int capacity);

    Pointer WintunReceivePacket(Pointer sessionHandle, IntByReference packetSize);

    void WintunSendPacket(Pointer sessionHandle, Pointer packet);

    void WintunReleaseReceivePacket(Pointer sessionHandle, Pointer packet);

    Pointer WintunGetReadWaitEvent(Pointer sessionHandle);

    void WintunGetAdapterLuid(Pointer sessionHandle, Pointer luid);

    Pointer WintunAllocateSendPacket(Pointer sessionHandle, int packetSize);

    void WintunCloseAdapter(Pointer sessionHandle);
}
